home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 12 / Cream of the Crop 12 (Part II) / Cream of the Crop 12 (Part II).iso / BBS / IEMSI002.ZIP / IEMSI.DOC < prev    next >
Encoding:
Text File  |  1996-01-18  |  17.7 KB  |  398 lines

  1. Documentation for the Interactive Electronic Mail Standard Identification
  2. (IEMSI) "include" file (January 1996 Release) for Maximus 3.
  3.  
  4. Included in this file:
  5.  
  6.         I.   Introduction.
  7.         II.  Setting up the IEMSI.MH file.
  8.         III. The IEMSI.MH functions and structures.
  9.         IV.  How IEMSI works.
  10.  
  11.  
  12.  
  13. I. Introduction.
  14.  
  15.         IEMSI is an automated information exchange protocol where the remote
  16. and server learn the name, location, and terminal settings of one another so
  17. the user doesn't have to manually set his/her settings in the BBS's Change
  18. Setup menu.  The included IEMSI.MH file was written in Maximus' MEX programming
  19. language and brings Maximus 3 Sysops the option of having it.
  20.  
  21.         Please freely distribute the IEMSI.MH include file, along with this one
  22. (IEMSI.DOC) as much as you want.  You may edit it to your liking, but I ask
  23. that you not distribute any of those edited copies for two reasons: 1) People
  24. might have a problem with the file, and will ask me why it doesn't work.  I
  25. won't be able to help them if the file has been edited (usually the cause of a
  26. problem is the result of an edit).  2) The people that helped me out were
  27. noted, and I believe them and myself deserve credit for the file, and not a
  28. person that decides to take that information out of the file, and replace it
  29. with his/her name.
  30.  
  31.         You may contact me by Fidonet Netmail at 1:215/9874, or the Internet at
  32. Made.In.USA@yuronet.cmnsens.fidonet.org for problems, questions, or (dare I say
  33. it?) compliments.
  34.  
  35.         Both BETTER.MEX and SIMPLE.MEX (included with this archive) will run
  36. under the DOS version of Maximus 3 without a problem.
  37.  
  38.         Please review section two for implementing information, and section
  39. three for advanced programming information.
  40.  
  41.  
  42.  
  43. II. Setting up the IEMSI.MH file.
  44.  
  45.  
  46. 1. Copy the files from the archive into your \Max\M directory.
  47.  
  48. 2. Open the IEMSI.MH file with an editor of your choice.
  49.  
  50. 3. Move the cursor to line 28 and follow the set up directions in the file.  If
  51.    you plan to use the included BETTER.MEX or SIMPLE.MEX for a login program,
  52.    it's recommended that you comment out the '#define DO_EXTRA' line since
  53.    these MEX programs won't use the extra features.  It will reduce the time
  54.    needed for the program to run.
  55.  
  56. 4. Save and close the file.
  57.  
  58. 5. Use one of the provided MEX programs for your logins, or make your own
  59.    program.  If you use the BETTER.MEX, be sure to edit its define lines
  60.    (instructions can be found in the file).  SIMPLE.MEX doesn't require any
  61.    editing for use.
  62.  
  63.    If you wish to make your own login MEX program, see section III.  If there
  64.    are special instructions for setting up the programs that come with this
  65.    archive, they will be found at the beginning of the file.
  66.  
  67. 6. Compile the MEX program using the MEX(P) command:
  68.  
  69.         DOS> MEX BETTER.MEX
  70.         OS2> MEXP BETTER.MEX
  71.  
  72. 7. Open your LOGO.MEC file, and place the following line at the end of the
  73.    file (assuming you are using the original LOGO.MEC):
  74.  
  75.         [MEX]d:\path\BETTER.VM
  76.  
  77.    Where d: is the drive, path is the path to the file (usually \max\m), and
  78.    BETTER.MEX is the name of the program you are using for IEMSI logins (either
  79.    SIMPLE.MEX, BETTER.MEX, or a program you made yourself).  Or, you can run
  80.    only the MEX program to log a user in (bypassing the LOGO.MEC file) by
  81.    opening your MAX.CTL file and changing the following line:
  82.  
  83.         Uses Logo       Misc\Logo
  84.  
  85.    to:
  86.  
  87.         Uses Logo       :M\BETTER.VM
  88.  
  89.    Don't forget to run SILT(P) if you change your MAX.CTL file.
  90.  
  91. 8. Compile your LOGO.MEC file using the MECCA(P) command from your \Max
  92.    directory:
  93.  
  94.         DOS> MECCA MISC\LOGO
  95.         OS2> MECCAP MISC\LOGO
  96.  
  97. 9. That's it.  Users that have the IEMSI capability should be able to log into
  98.    your BBS automatically.  If you want to have the MEX program automatically
  99.    update the user's configuration, you will have to make your own MEX program
  100.    using the usercreate(), userupdate(), userfindopen(), and userfindclose()
  101.    functions.  In this case, you need information about the variables in the
  102.    _emsi_data structure (see section III below).
  103.  
  104.  
  105.  
  106. III. The IEMSI.MH functions and structures.
  107.  
  108.  
  109.         All of the functions useful to any programmer are listed below.  There
  110. ARE other functions in the file, but they are needed only for the IEMSI
  111. process.  Note that some of these functions require that others be prototyped
  112. also in order to properly function.
  113.  
  114.  
  115.             struct _emsi_data
  116.  
  117. Description This structure contains all the information received from the
  118.             remote.  It describes who, where, and how to contact the person,
  119.             the remote's terminal capabilities, what the user wants and
  120.             doesn't want during the login process, and the terminal software
  121.             the remote is using.
  122.  
  123. Notes       If protocols.directzap and/or protocols.zedzap are found TRUE, and
  124.             you don't have those external protocols installed, have your
  125.             program interpret them as the Zmodem protocol.  If Kermit is found
  126.             TRUE, and you don't have an external protocol program installed
  127.             for it, you will need to use another protocol that is found TRUE,
  128.             prompt the user about which protocol to use, or have a default
  129.             protocol of none set instead.
  130.  
  131.             The different types of variables include strings (string), unsigned
  132.             characters (uns char), and singed longs (sin long).
  133.  
  134. Field                     Type     Description
  135. ------------------------- -------- --------------------------------------------
  136. name                      string   The user's name.  The first letter of each
  137.                                    word is capitalized. (e.g. "Yuri Wiitala")
  138. alias                     string   The user's alias.  The first letter of each
  139.                                    word is capitalized. (e.g. "Made In Usa")
  140. location                  string   The user's location. (e.g. "Pleasanton, CA")
  141. data_number               string   The user's data phone number, if any.  Some
  142.                                    terminal programs put the voice number here
  143.                                    by mistake.  (e.g. "(510) 555-1212")
  144. voice_number              string   The user's voice phone number.
  145.                                    (e.g. "(510) 555-1212")
  146. password                  string   Case insensitive; all letters are made
  147.                                    lowercase.  (e.g. "secret")
  148. birthdate;                sin long User's birthday in UNIX notation (seconds
  149.                                    elapsed since Jan 1, 1970).  Use
  150.                                    long_to_stamp() function to convert to a
  151.                                    useful date.  (e.g. "788940000")  This can
  152.                                    be a negative number if the user was born
  153.                                    before Jan 1, 1970.
  154.  
  155. The following are only available if the '#define DO_EXTRA' line is NOT
  156. commented:
  157.  
  158. Field                     Type     Description
  159. ------------------------- -------- --------------------------------------------
  160. soft_name                 string   The user's terminal emulation program.
  161.                                    (e.g. "Zap-O-Comm")
  162. ver                       string   Version of the user's terminal emulation
  163.                                    program.  (e.g. "2.052")
  164. serial                    string   Serial number of the user's terminal
  165.                                    emulation program.  (e.g. "4A-24E7CB-4C3")
  166. crtdef.tty                uns char TRUE if TTY terminal emulation is supported.
  167. crtdef.avatar             uns char TRUE if AVATAR/0+ and ANSI X3.64 are
  168.                                    supported.
  169. crtdef.ansi               uns char TRUE if only ANSI X3.64 is supported.
  170. crtdef.vt52               uns char TRUE if DEC VT52 is supported.
  171. crtdef.vt100              uns char TRUE if DEC VT100 is supported.  VT100 is
  172.                                    compatible with ANSI codes, but it will not
  173.                                    display color on the user's end.
  174. crtdef.len                uns char The length of the user's screen in rows.
  175. crtdef.width              uns char The width of the user's screen (num of
  176.                                    chars).
  177. crtdef.nulls              uns char The number of nulls required.
  178. protocols.directzap       uns char TRUE if the user can use the DirectZAP file
  179.                                    transfer protocol.  (a variant of ZedZAP)
  180. protocols.zedzap          uns char TRUE if the user can use the ZedZap file
  181.                                    transfer protocol.  (a Zmodem variant)
  182. protocols.zmodem          uns char TRUE if the user supports Zmodem. (1024 byte
  183.                                    data packets)
  184. protocols.sealink         uns char TRUE if the user supports SEAlink.
  185. protocols.kermit          uns char TRUE if the user supports Kermit.
  186. capabilities.tabs         uns char TRUE if the user's terminal software can
  187.                                    handle TAB (ASCII 09H) characters.
  188. capabilities.ibmchars     uns char TRUE if the user's terminal software can
  189.                                    handle 8-bit IBM PC ASCII characters.
  190. requests.news             uns char TRUE if the user wants to have bulletins,
  191.                                    announcements, etc., displayed.
  192. requests.mailcheck        uns char TRUE if the user wants to check for new
  193.                                    mail.
  194. requests.hotkeys          uns char TRUE is the user wants to use hotkeys.
  195. requests.scrnclr          uns char TRUE if the user wants screen clearing codes
  196.                                    to be sent.
  197. requests.nopage           uns char TRUE if the user is not available for chat
  198.                                    (paging disabled).
  199. requests.more             uns char TRUE if a more prompt should be sent after a
  200.                                    screen of information.
  201. requests.fullscred        uns char TRUE if the full screen message editor/reader
  202.                                    should be enabled.
  203.  
  204.  
  205.             capitalize()
  206.  
  207. Prototype   string capitalize(string: wrongcase)
  208.  
  209. Arguments   wrongcase   A string containing any mixture of cases.
  210.  
  211. Return Val. The same string with proper capitalization.
  212.  
  213. Description The first letter of each word of the given string is capitalized,
  214.             and the remaining letters of each word are changed to lowercase.
  215.             This function is useful for properly capitalizing names in
  216.             situations where you cannot be sure that proper capitalization has
  217.             been used.
  218.  
  219.  
  220.             crc_32_tab()
  221.  
  222. Prototype   unsigned long crc_32_tab(unsigned long: index);
  223.  
  224. Arguments   index       An unsinged long from 0 to 255, which is the index of
  225.             the crc_32_tab array to be returned.
  226.  
  227. Return Val. The calculated value from the crc_32_tab array at the given index.
  228.  
  229. Description Instead of using the famous crc_32_tab table, used in CRC
  230.             calculations, this function calculates what the variable at "index"
  231.             would contain.  Calculating rather than using the table shortens
  232.             the amount of code in the program, and the resources required for
  233.             the program to run.
  234.  
  235.             NOTE: This function will only be available if DO_CRC32 is defined.
  236.  
  237.  
  238.             crc32()
  239.  
  240. Prototype   string crc32(string: strtoproc);
  241.  
  242. Arguments   strtoproc   The string to calculate the Cycle Redundancy Check on.
  243.  
  244. Return Val. The calculated CRC of the given string.
  245.  
  246. Description This function takes the given string and calculates a Cycle
  247.             Redundancy Check (CRC) on it.  A CRC helps two programs make sure
  248.             that data being transmitted over a modem is 100% error free.
  249.  
  250.             NOTE: This function will only be available if DO_CRC32 is defined.
  251.  
  252.  
  253.             hexstrtolong()
  254.  
  255. Prototype   signed long hexstrtolong(string: strtoproc);
  256.  
  257. Arguments   strtoproc   The string containing the hexadecimal number to be
  258.             converted to decimal.
  259.  
  260. Return Val. The hex number converted to decimal.
  261.  
  262. Description This function takes a string containing a hexadecimal number and
  263.             converts it to a signed long in decimal.
  264.  
  265.  
  266.             iemsi_detect()
  267.  
  268. Prototype   signed int iemsi_detect(ref struct _emsi_data: recvdinfo);
  269.  
  270. Arguments   recvdinfo   The _emsi_data structure.  When the function is
  271.             complete, this structure will be filled with the user's information
  272.             if an IEMSI login was successful.
  273.  
  274. Return Val. -2, if a non-IEMSI response was received.  -1, if the ICI packet
  275.             could not be received from the remote properly.  0, if there was no
  276.             response to the EMSI_IRQ.  1, if the user's information was
  277.             retrieved successfully from the remote, but the remote couldn't
  278.             receive the ISI packet successfully.  2 = The IEMSI negotiation was
  279.             100% successful.
  280.  
  281.             If the returned value is greater than zero, the structure will be
  282.             filled with the user's information.  If the value is less than
  283.             zero, assume that the user does not support IEMSI logins, his/her
  284.             software does not conform to 100% of the IEMSI specifications, or
  285.             the connection between the BBS and the user is very faulty
  286.             (information cannot be exchanged without error).
  287.  
  288. Description This functions performs an IEMSI negotiation, and if the user
  289.             supports IEMSI logins, will get the information needed, and will
  290.             send the user information about the BBS.  It takes only one second
  291.             to determine if the user supports IEMSI, so it will not be
  292.             noticeable to a user that does not support it.
  293.  
  294.  
  295.             longtohexstr()
  296.  
  297. Prototype   string longtohexstr(unsigned long: numtoproc);
  298.  
  299. Arguments   numtoproc   The number of type unsigned long to convert to hex.
  300.  
  301. Return Val. The eight character string containing the number converted to hex.
  302.             If the number is not large enough to take up all eight digits,
  303.             zeros are added in front of the number.
  304.  
  305. Description This function takes a number of type unsinged long (in decimal),
  306.             and converts it to an eight character string containing the hex
  307.             equivalent.
  308.  
  309.             NOTE: This function will only be available if DO_CRC32 is defined.
  310.  
  311.  
  312.             status_message()
  313.  
  314. Prototype   void status_message(string: statmsg);
  315.  
  316. Arguments   statmsg     The string to print to the local screen about the IEMSI
  317.             connection.
  318.  
  319. Return Val. No value will be returned since the function is of 'void' type.
  320.  
  321. Description This function will print a status message to only the local screen
  322.             about the current progress with the IEMSI negotiation.
  323.  
  324.  
  325.             toupper()
  326.  
  327. Prototype   unsigned char toupper(unsigned char: letter);
  328.  
  329. Arguments   letter      The letter to be converted to upperase.
  330.  
  331. Return Val. The letter capitalized.
  332.  
  333. Description This function takes a lowercase letter and makes it uppercase.  If
  334.             the letter is already upperase, or the character given is not a
  335.             letter at all, the given character will be returned.
  336.  
  337.  
  338.             xor32()
  339.  
  340. Prototype   unsigned long xor32(unsigned long: compare1, unsigned long: compare2)
  341.  
  342. Arguments   compare1    One of the two values to be compared by the "exclusive
  343.             or" process.  It is of type unsigned long.
  344.  
  345.             compare2    The other value to be compared, also an unsigned long.
  346.  
  347. Return Val. The result of the "exclusive or" operation in an unsigned long.
  348.  
  349. Description This function performs an "exclusive or" on the bits of two
  350.             unsigned long numbers.  This process compares the corresponding
  351.             bits of each number and returns the following according to the
  352.             following:
  353.  
  354.             1 and 1 ──> 0
  355.             1 and 0 ──> 1
  356.             0 and 1 ──> 1
  357.             0 and 0 ──> 0
  358.  
  359.             NOTE: This function will only be available if DO_CRC32 is defined.
  360.  
  361.  
  362.  
  363. IV. How IEMSI works.
  364.  
  365.         The IEMSI information exchange starts with the server (BBS) sending the
  366. EMSI_IRQ packet.  This packet never changes, and is "**EMSI_IRQ8E08."  If the
  367. remote is IEMSI capable, it should then send its EMSI_ICI packet.
  368.  
  369.         This packet contains the "**EMSI_ICI" string, the length of the ICI
  370. packet in hex, the actual packet data, and then a 32-bit Cycle Redundancy Check
  371. (CRC).  Since this packet could contain any kind of data, the CRC is necessary
  372. to ensure everything it contains is error-free.  If the packet is found to be
  373. okay, the server sends its EMSI_ISI packet to the remote.  If not, the EMSI_NAK
  374. packet is sent to let the remote know that the EMSI_ICI packet needs to be
  375. resent.
  376.  
  377.         The EMSI_ISI packet contains the "**EMSI_ISI" string, the length of the
  378. ISI packet in hex, the packet data (containing the BBS information), and the
  379. CRC in hex.  If the remote deems the EMSI_ISI packet to be correct, the
  380. EMSI_ACK packet is sent back twice.  If not, the EMSI_NAK packet is sent, and
  381. the server should send the EMSI_ISI packet again.
  382.  
  383.         At any time during this process, if either side sends an EMSI_IIR
  384. packet, the negotiation is cancelled, and should not proceed further.  This
  385. usually means that one side or the other feels the packets have a slim chance
  386. of making it to the other error-free.  Since this packet never changes, it is
  387. always "**EMSI_IIR61E2."
  388.  
  389.         Also, the EMSI_ACK and EMSI_NAK packets should be noted.  They are
  390. "**EMSI_ACKA490" and "**EMSI_NAKEEC3" respectively.
  391.  
  392.         In addition, every packet in the IEMSI negotiation ends with an ASCII
  393. 13 (dec) character - better known as the CR, or carriage return.
  394.  
  395.  
  396.  
  397. ─=End of IEMSI.DOC=─
  398.